
 

<template>
  <div>
       <div>
            <p> 被点击了 {{counts}} 次</p>
            <el-button @click="handerChile"> 子组件按钮 </el-button>
       </div>
  </div>
</template>
 
<script>
export default {
  name:"HelloWorld",
  props:['counts'],
  data(){
    return{
      number:this.counts,

    }
  },
  methods:{
       handerChile(){
            this.number++
            this.$emit('update:counts',this.number)
       }
  }
}
</script>
 
<style>
 
</style>